:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.5;
  font-weight: 400;
  color: #213547;
  background-color: #ffffff;
}

body {
  margin: 0;
  display: flex;
  place-items: center;
  min-width: 320px;
  min-height: 100vh;
}

#app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
}

.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
  background: #f5f5f5;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  max-width: 800px;
  margin: 0 auto;
}

.game-header {
  margin-bottom: 1rem;
}

.game-info {
  display: flex;
  gap: 3rem;
  font-size: 1.2rem;
  background: #fff;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.game-board {
  display: grid;
  gap: 2px;
  padding: 15px;
  background: #e0e0e0;
  border-radius: 12px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  margin: 0 auto;
}

.game-controls {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
}

.game-controls button {
  padding: 0.8rem 1.5rem;
  font-size: 1.1rem;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.game-controls button:hover {
  background: #45a049;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.theme-selector {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.theme-selector select {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  background: #fff;
  transition: all 0.2s ease;
}

.theme-selector select:hover {
  border-color: #4CAF50;
}

/* 主题样式 */
.theme-classic .game-board {
  background: #e0e0e0;
}

.theme-sci-fi .game-board {
  background: #1a1a2e;
  box-shadow: 0 0 20px #00ff00;
}

.theme-cartoon .game-board {
  background: #ffd700;
  box-shadow: 0 0 20px #ff6b6b;
}

/* 游戏元素样式 */
.cell {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 6px;
  position: relative;
  transition: all 0.2s ease;
}

.wall {
  background: #666;
  border: 2px solid #555;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
  width: 100%;
  height: 100%;
}

.player, .box, .target {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
}

.player {
  width: 30px;
  height: 30px;
  background: #4CAF50;
  border-radius: 50%;
  margin: auto;
}

.box {
  width: 34px;
  height: 34px;
  background: #795548;
  border-radius: 4px;
  margin: auto;
}

.target {
  width: 20px;
  height: 20px;
  background: #FFC107;
  border-radius: 50%;
  margin: auto;
}

/* 箱子在目标点上的样式 */
.box.on-target {
  background: #4CAF50;
  border: 2px solid #2E7D32;
}

/* 添加教程样式 */
.tutorial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.tutorial-content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  max-width: 400px;
  text-align: left;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tutorial-content h3 {
  margin-top: 0;
  color: #333;
}

.tutorial-content ul {
  padding-left: 1.5rem;
  margin: 1rem 0;
}

.tutorial-content li {
  margin: 0.5rem 0;
  color: #666;
}

.tutorial-close {
  width: 100%;
  padding: 0.8rem;
  margin-top: 1rem;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.tutorial-close:hover {
  background: #45a049;
}

/* 动画效果 */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes glow {
  from { box-shadow: 0 0 5px #FFC107; }
  to { box-shadow: 0 0 15px #FFC107; }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .game-container {
        padding: 1rem;
        max-width: 100%;
    }

    .cell {
        width: 35px;
        height: 35px;
    }

    .game-controls {
        flex-direction: column;
        gap: 0.5rem;
    }

    .game-controls button {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
    }

    .game-info {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem;
    }
}

/* 添加触摸控制按钮 */
.touch-controls {
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .touch-controls {
        display: grid;
    }
}

.touch-btn {
    padding: 1rem;
    background: rgba(76, 175, 80, 0.8);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.5rem;
}

.touch-btn:active {
    background: rgba(76, 175, 80, 1);
}

/* 规则按钮特殊样式 */
#rules-btn {
    background: #2196F3;
}

#rules-btn:hover {
    background: #1976D2;
}

/* 选关对话框样式 */
.level-select-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.level-select-overlay.hidden {
    display: none;
}

.level-select-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.level-btn {
    padding: 1rem;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.1rem;
}

.level-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 完成状态样式 */
.level-btn.completed {
    background: #2196F3;
}

.level-btn.completed:hover {
    background: #1976D2;
}

.close-btn {
    width: 100%;
    padding: 0.8rem;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1rem;
}

.close-btn:hover {
    background: #d32f2f;
}
